function [bits_count, probabilities] = adaptive_cost_A(x, alphabet_size)
    [bits_count, probabilities] = adaptive_cost(x, alphabet_size, @probability_A);
end

function [p] = probability_A(num, t, alph_size,cur_alph_size)
	if (cur_alph_size == alph_size)
		p = num / t; 
        else
            if (num == 0)
                p = 1 /(t + 1)/(alph_size - cur_alph_size);
            else 
                p = num / (t + 1);
            end;
	end;
end
